const user = {
  state: {
    menus: [{
      'id': 1
    }]
  },
  mutations: {
    SET_MENUS: (state, menus) => {
      state.menus = menus
    }
  },
  actions: {
    generateMenus ({commit}, data) {
      return new Promise(resolve => {
        const menus = [
          {
            'id': 1,
            'name': 2,
            'children': [
              {
                'id': 1,
                'name': 2
              }
            ]
          }, {
            'id': 2
          }
        ]
        commit('SET_MENUS', menus)
        resolve()
      })
    }
  }
}

export default user
